package com.getui.util;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import com.igexin.sdk.PushConsts;

/**
 * Created by Lenovo on 2014/6/18.
 */
public class ClientInfor extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        Bundle bundle = intent.getExtras();
        Log.d("GetuiSdkDemo", "onReceive() action=" + bundle.getInt("action"));
        switch (bundle.getInt(PushConsts.CMD_ACTION)){
            case PushConsts.GET_MSG_DATA:
                byte[] payload = bundle.getByteArray("payload");
                if (payload != null){
                    String data = new String(payload);
                    Log.d("GetuiSdkDemo", "Got Payload:" + data);
                }
                break;
            case PushConsts.GET_CLIENTID:
                String cid = bundle.getString("clientid");
                Log.d("GetuiSdkDemo", "Got ClientID:" + cid);
                break;
        }

    }
}
